package com.wxs.common.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.wxs.common.pojo.Role;

/**
 * 角色管理
 * 
 * @author admin
 *
 */
@Mapper
public interface RoleMapper {
	int deleteByPrimaryKey(Integer id);

	int insert(Role record);

	int insertSelective(Role record);

	Role selectByPrimaryKey(Integer id);

	int updateByPrimaryKeySelective(Role record);

	int updateByPrimaryKey(Role record);

	List<Role> listRolesByGroupid(Integer id);

	List<Role> list(@Param("name") String name, @Param("enabled") Boolean enabled);

	@Delete("delete from role_resource where roleEntities_id=#{id}")
	int deleteRole_Resource(@Param("id") Integer role_id);

	@Delete("delete from rolegroup_role where roleEntities_id=#{id}")
	int deleteRolegroup_Role(@Param("id") Integer role_id);

	int saveRoleResource(@Param("resourceids") String[] resourceids, @Param("roleid") Integer roleid);

}